package com.cupdata.marathon.controller;

import com.cupdata.marathon.param.download.DownloadRequest;
import com.cupdata.marathon.param.download.DownloadResponse;
import com.cupdata.marathon.service.impl.CouponServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/coupon")
public class CouponController {

    @Autowired
    CouponServiceImpl couponService;

    @PostMapping("/download")
    public DownloadResponse call(@Validated @RequestBody DownloadRequest downloadRequest) {
        return couponService.call(downloadRequest);
    }


}
